home *** CD-ROM | disk | FTP | other *** search
/ System Booster / System Booster.iso / SYS / s / filemode.mrbk < prev    next >
Text File  |  1996-09-26  |  1KB  |  66 lines

  1. /* filemode.mrbk */
  2.  
  3. /* This ARexx script plays with MRBackup's filemode setting. */
  4.  
  5. signal on ERROR
  6. signal on BREAK_C
  7.  
  8. parse source type res called resolved ext host
  9.  
  10. options results
  11.  
  12. if ~(Show('P', 'MRBackup_#1')) then do
  13.     say "You must run MRBackup first. With a little work, you could"
  14.     say "get this ARexx script to do it for you."
  15.     exit 1
  16. end
  17.  
  18. address "MRBackup_#1"
  19.  
  20. /* poptofront */
  21.  
  22. 'getfilemode'
  23. if rc ~= 0 then do
  24.     say "Failed to get filemode setting; rc = " || rc
  25.     exit rc
  26. end
  27.  
  28. filemode = result
  29.  
  30. say "Current filemode: " || filemode
  31.  
  32. if filemode = "Replace" then
  33.     filemode = "Append"
  34. else
  35.     filemode = "Replace";
  36.  
  37. setfilemode filemode
  38. if rc ~= 0 then do
  39.     say "Failed to set filemode; rc = " || rc
  40.     exit rc
  41. end
  42.  
  43. getfilemode
  44.  
  45. say "  Filemode is now set to " || result
  46.  
  47. exit 0
  48.  
  49.  
  50. /*------------------------------------------------------------------*/
  51.  
  52. break_c:
  53.  
  54. say "*** Control-C recieved.  Stopped by user. ***"
  55. exit 5
  56.  
  57. /*------------------------------------------------------------------*/
  58.  
  59. error:
  60.  
  61. say "Error"
  62. exit 6
  63.  
  64. /*------------------------------------------------------------------*/
  65.  
  66.